from src.record.recordController import record_audio,list_audio_devices
from src.record.BaiDuApiAudioToText import BaiDuApiAudioToText
from src.record.BaiDuApiNPL import BaiDuApiNPL
import os
import sys
from src.yamlLoader import YamlLoader
from src.snowboy.snowboy import Snowboy

# 示例：录制5秒音频并保存为output.wav
#record_audio("output.wav", record_seconds=10)

# config = YamlLoader().get_config()

# print(config)

# audioApi = BaiDuApiAudioToText(config=config,audioFile='output.wav')
# msg = audioApi.get_result_FastApi()
# print(msg)


# nplApi = BaiDuApiNPL(config=config)
# words = nplApi.get_WordSeg("你好，欢迎使用语音助手。")
# print(words)

Snowboy()

